package com.sunny.ynhz.ui.index;

import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.TextView;

import com.sunny.ynhz.R;
import com.sunny.ynhz.ui.base.BaseFragment;
import com.sunny.ynhz.widget.MyWebview;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/7/14/014.
 */

public class NewsDynamicFragment extends BaseFragment {
    public static NewsDynamicFragment getInstance() {
        return new NewsDynamicFragment();
    }

    @BindView(R.id.wb_view)
    MyWebview webView;
    @BindView(R.id.tv_load)
    TextView tv_load;

    @Override
    protected int setLayoutResourceID() {
        return R.layout.fragment_sta;

    }

    @Override
    protected void setUpView() {
        super.setUpView();

        String url = "";
        webView.loadUrl(url);
        webView.setWebChromeClient(new WebChromeClient() {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                // TODO 自动生成的方法存根

                if (newProgress == 100) {
                    tv_load.setVisibility(View.GONE);//加载完网页进度条消失
                } else {
                    tv_load.setVisibility(View.VISIBLE);//开始加载网页时显示进度条
                }

            }
        });
    }
}
